package com.candy.homework;

import java.util.Arrays;

/**
 * @author donglin
 * @Title:
 * @类名: Student
 * @date 2020/7/23
 */
public class Student {
    private  String stuName;
    private int stuID;
    private int score;

    public Student() {
    }

    public Student(String stuName, int stuID, int score) {
        this.stuName = stuName;
        this.stuID = stuID;
        this.score = score;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public int getStuID() {
        return stuID;
    }

    public void setStuID(int stuID) {
        this.stuID = stuID;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "stuName='" + stuName + '\'' +
                ", stuID=" + stuID +
                ", score=" + score +
                '}';
    }
    
    public static void sore(Student[] stus){
        int len=stus.length;
        int[] a=new int[len];
        for (int i = 0; i <len ; i++) {
            a[i]=stus[i].getScore();
        }
        Arrays.sort(a);
        for (int i = a.length-1; i >=0 ; i--) {
            for (int j = 0; j <stus.length ; j++) {
                if (stus[j].getScore()==a[i]){
                    System.out.println(stus[j]);
                }

            }
            
        }
        
        
        
        
        
    }
    
}
